﻿@{
	ViewBag.Title = "工作流";
	Layout = "~/Views/Shared/_Layout.cshtml";
}
@model OASys.Web.Areas.ModuleWF.Models.ModelWorkFlowIndex
<script type="text/javascript">

	function create() {
		window.top.openDialog({ Url: "/ModuleWF/WorkFlow/Create/?pageState=" + create, Title: "新增工作流", Width: 400, Height: 200 });
	}

	function edit(id) {
		window.top.openDialog({ Url: "/ModuleWF/WorkFlow/Create/" + id + "/?pageState=" + edit, Title: "编辑工作流", Width: 400, Height: 200 });
	}

	function deleteWF(id) {
		top.window.$("#sysConfirm").html("确定要删除？");
		top.window.$("#sysConfirm").dialog({
			resizable: false,
			height: 200,
			title: "系统提示",
			modal: true,
			buttons: {
				"是": function () {
					$.ajax({
						type: "POST",
						url: "/ModuleWF/WorkFlow/delete/",
						data: "id=" + id,
						success: function (msg) {
							msg = eval("(" + msg + ")");
							if (msg.result == "") {
								window.top.refresh();
								window.top.showSysMessage();
							}
							else {
								window.top.showSysAlert(msg.result);
							}
						}
					});
					top.window.$("#sysConfirm").dialog("close");
				},
				"否": function () {
					top.window.$("#sysConfirm").dialog("close");
				}
			}
		});
	}

	function show(id) {
		window.top.openDialog({ Url: "/ModuleWF/WorkFlow/Create/" + id + "?pageState=" + detail, Title: "查看工作流", Width: 400, Height: 200 });
	}

	function setStep() {
		var id = defaultTable.forceSelectOne();
		if ( id == null)
			return;
		window.top.openDialog({ Url: "/ModuleWF/WorkFlowStep/Index/?FlowId=" + id, Title: "工作流流程设置", Width: 700, Height: 600 });
	}

</script>
<div>
	@using (Html.BeginForm())
 {
	 /* 工具栏部分 toolbar
	 ----------------------------------------------------------*/
		<div class="toolbar">
			<div class="toolbar-left">
				@Html.Button(ButtonType.新增, "create()")
				@Html.Button(ButtonType.设置, "setStep()", "工作流步骤设置")
				@Html.Button(ButtonType.条件查询, "commonPage.scan()")
			</div>
			<div class="toolbar-right">
				@Html.TextBoxFor(x => x.SearchEntity._CommonSearchCondition, new { @class = "common-search-condition" })
				<input type="submit" class="common-search-submit" value="" />
			</div>
		</div>
     
	 /* 组合条件查询 search-container
        ----------------------------------------------------------*/
		<div class="search-container">
			
		</div>
     
	 /* 说明文字
        ----------------------------------------------------------*/
		<div class="search-clue">
			您可通过该功能，查询系统工作流
		</div>

	 /* 表格数据显示
          ----------------------------------------------------------*/
	 <div class="replace-container">
		@{
			Html.RenderPartial("Index_Partial");
		}
	 </div>
 }
</div>
